﻿@using WebUI.Areas.Admin.Models
@{
	Layout = "~/Areas/Admin/Views/Shared/_Admin.cshtml";
	ViewBag.Title = "后台管理中心 - 教学评价系统";
}
@section head {
	<!-- Tell the browser to be responsive to screen width -->
	<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
	<link rel="stylesheet" href="/dist/AdminLTE/bower_components/bootstrap/dist/css/bootstrap.min.css">
	<!-- Font Awesome -->
	<link rel="stylesheet" href="/dist/AdminLTE/bower_components/font-awesome/css/font-awesome.min.css">
	<!-- Ionicons -->
	<link rel="stylesheet" href="/dist/AdminLTE/bower_components/Ionicons/css/ionicons.min.css">
	<!-- Theme style -->
	<link rel="stylesheet" href="/dist/AdminLTE/dist/css/AdminLTE.min.css">
	<link rel="stylesheet" href="/dist/AdminLTE/dist/css/skins/skin-blue.min.css">
	<!--[if lt IE 9]>
		<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
		<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
	<![endif]-->
	<link href="~/dist/loader/loading.css" rel="stylesheet" />
}
@section body {
	<!-- jQuery -->
	<script src="/Scripts/jquery-1.12.0.min.js"></script>
	<!-- Bootstrap 3.3.7 -->
	<script src="/dist/AdminLTE/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
	<!-- AdminLTE App -->
	<script src="/dist/AdminLTE/dist/js/adminlte.min.js"></script>
	<script src="/dist/pjax/jquery.pjax.js"></script>
	<script src="~/Scripts/jquery.validate.min.js"></script>
	<script src="~/Scripts/jquery.validate.unobtrusive.min.js"></script>
	<script src="~/Scripts/jquery.unobtrusive-ajax.min.js"></script>
	<script src="/dist/push.js/push.min.js"></script>
	<script>
		$(function () {
			$(".js-left-menu-a").on("click", function () {
				$("#loading").css("display", "block");
			});

			var iframe = document.getElementById("js-iframe-content");
			if (iframe.attachEvent) {
				iframe.attachEvent("onload", function () {
					iframeLoadComplate();
				});
			} else {
				iframe.onload = function () {
					iframeLoadComplate();
				};
			}
		});

		function iframeLoadComplate() {
			document.getElementById("loading").style.display = "none";
		}

		function pushMessage(title, message, imageUrl, redirectUrl) {
			Push.create(title, {
				body: message,
				icon: imageUrl,
				timeout: 4000,
				onClick: function () {
					window.focus();
					this.close();
					if (redirectUrl != null && redirectUrl != '') {
						window.location.href = redirectUrl;
					}
				}
			});
		}

		function selectTemplate(id) {
			$.ajax({
				url: '/Admin/ThemeTemplate/SelectTemplate',
				type: 'post',
				data: { id: id },
				dataType: 'json',
				success: function (data) {
					if (data.code <= 0) {
						pushMessage('切换模板失败', data.message);
					} else {
						window.location.href = window.location.href;
					}
				}
			});
		}
	</script>
}